package org.jeecg.modules.middle.business.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.manage.entity.CaishuiBusiness;
import org.jeecg.modules.manage.entity.CaishuiBusinessBank;
import org.jeecg.modules.manage.entity.CaishuiBusinessUser;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 商户基本信息表
 * @Author: yfkj
 * @Date:   2023-02-07
 * @Version: V1.0
 */
public interface ICaishuiBusinessService extends IService<CaishuiBusiness> {

	//=================================树结构============================
	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "0";

	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";

	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**
	 * 新增节点
	 *
	 * @param caishuiBusiness
	 */
	void addCaishuiBusiness(CaishuiBusiness caishuiBusiness);

	/**
	 * 修改节点
	 *
	 * @param caishuiBusiness
	 * @throws JeecgBootException
	 */
	void updateCaishuiBusiness(CaishuiBusiness caishuiBusiness) throws JeecgBootException;

	/**
	 * 删除节点
	 *
	 * @param id
	 * @throws JeecgBootException
	 */
	void deleteCaishuiBusiness(String id) throws JeecgBootException;

	/**
	 * 查询所有数据，无分页
	 *
	 * @param queryWrapper
	 * @return List<CaishuiBusiness>
	 */
	List<CaishuiBusiness> queryTreeListNoPage(QueryWrapper<CaishuiBusiness> queryWrapper);

	/**
	 * 【vue3专用】根据父级编码加载分类字典的数据
	 *
	 * @param parentCode
	 * @return
	 */
	List<SelectTreeModel> queryListByCode(String parentCode);

	/**
	 * 【vue3专用】根据pid查询子节点集合
	 *
	 * @param pid
	 * @return
	 */
	List<SelectTreeModel> queryListByPid(String pid);

	//=================================树结构============================

	//=================================一对多结构============================
	/**
	 * 添加一对多
	 *
	 * @param caishuiBusiness
	 * @param caishuiBusinessUserList
	 * @param caishuiBusinessBankList
	 */
	public void saveMain(CaishuiBusiness caishuiBusiness, List<CaishuiBusinessUser> caishuiBusinessUserList, List<CaishuiBusinessBank> caishuiBusinessBankList) ;
	
	/**
	 * 修改一对多
	 *
   * @param caishuiBusiness
   * @param caishuiBusinessUserList
   * @param caishuiBusinessBankList
	 */
	public void updateMain(CaishuiBusiness caishuiBusiness, List<CaishuiBusinessUser> caishuiBusinessUserList, List<CaishuiBusinessBank> caishuiBusinessBankList);
	
	/**
	 * 删除一对多
	 *
	 * @param id
	 */
	public void delMain(String id);
	
	/**
	 * 批量删除一对多
	 *
	 * @param idList
	 */
	public void delBatchMain(Collection<? extends Serializable> idList);

	//=================================一对多结构============================

}
